﻿using Face8280WebSocketServer.Command;
using DoNetDrive.Core.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DoNetDrive.Core.Packet;
using Newtonsoft.Json.Serialization;

namespace Face8280WebSocketServer.Command.Person
{
    public class GetPersonList : JsonCommand
    {
        public GetPersonList(INCommandDetail cd, int pageNum, int pageSize = 100) : base(cd, null)
        {
            mSendObject = new { cmd = Reply, pageNum, pageSize };
              mJsonResult = (s) => _Result = new GetPersonListResult(s);
        }

        //protected override void CommandNext(INPacket readPacket)
        //{
        //    if (readPacket is JsonPacket)
        //    {
        //        var jPck = readPacket as JsonPacket;
        //        var sJson = jPck.GetJson();
        //        if (CheckJsonResult(sJson) == false)
        //        {
        //            return;
        //        }
        //        var result = sJson.FromJson<GetPersonList_DTO>();
        //        _Result = new GetPersonListResult(result);
        //        CommandCompleted();
        //        return;
        //    }
        //}

        class CmdResult
        {

            public int Total { get; set; }
            public Models.PersonModel Person { get; set; }
            public string Reply { get; set; }
            public int Result { get; set; }
        }


    }


}
